Buttonhole stitches may be automatically produced with the prior art electronic sewing machines in response to buttonhole stitch control data stored in a memory unit mounted in the sewing machine. The buttonhole stitches include in general bar tacks for reinforcing opposite longitudinal ends of the buttonhole and first and second series of line tacks located at opposite sides of the buttonhole. The length or stitch number of the line tacks should be varied in correspondence with the size or diameter of the button concerned, and some solutions for this purpose have been proposed. For example, a limit section of a presser foot is connected via a lever to a microswitch mounted in a machine housing. The lever may be a hindrance to the operator during stitching operation. Before starting operation, the operator is required to set the lever as well as the presser foot. Another proposal is to mount a photo-sensor in the machine housing and to provide a presser foot with a member cooperating with the photo-sensor to detect the extreme ends of the buttonhole stitches. However, since the member is located far from the photo-sensor, the member would tend to be misoperated in response to ambient light. It has also been proposed to mount an electric contact on a presser foot for detecting the button size. The electric contact is not sufficiently protected by a cover and therefore may often be operated by static electricity, resulting in the possibility of destroying an electric control circuit.
After completing the buttonhole stitching operation for one buttonhole, it is often desired to repeat the same operation for the same buttonhole or in some other case to produce buttonhole stitches for another buttonhole located apart from the first buttonhole. In the latter case, the presser bar is raised to stop the sewing machine operation and the fabric is shifted to a position where the sewing machine needle is adapted to produce a first stitch of the buttonhole stitched for the second buttonhole. At this stand-by condition, nevertheless, the sewing machine is driven by stepping on a controller, which may be dangerous to the sewing machine operator.
When the buttonhole stitches are produced with the electronic sewing machine, it is necessary to renew a pattern number designating the bar tacks to the next pattern number for the line tacks, and vice versa, in response to signals generated at a time when an extreme end of the buttonhole is detected with sensor means. The bar tacks may be stitched by reciprocating the needle with little or no fabric feeding, which may cause the sensor means to output the signal to erroneously step-up the pattern number.